package com.niren.deviceservice.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.niren.commonmodule.entity.SysDeviceInfo;
import com.niren.deviceservice.config.NacosConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * \* author: wky
 * \* Date: 2024/11/21
 * \* Time: 10:46
 * \* Project: microservice
 * \* Package: com.niren.deviceservice.controller
 * \* Version: 1.0.0
 * \* To change this template use File | Settings | File Templates.
 * \* Description:请输入源文件描述
 * \
 */
@RestController
@RequestMapping("/device")
public class DeviceController {


    @GetMapping("/test")
    public String test() {
        return "this is device service! -> " + NacosConfig.instance.getUseLocalCache();
    }

    @RequestMapping("/adddevinfo")
    public String addDevInfo(@RequestBody SysDeviceInfo dev) {
        return "添加设备成功!设备名:" + dev.getDevName() + " , 设备条码:" + dev.getDevSn();
    }
}
